<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     * php artisan db:seed
     * @return void
     */
    public function run()
    {
        // 调用其它 Seeders
        // $this->call([
        //     CmsFieldTypeSeeder::class
        // ]);
        // 后台项目默认管理员
        $default = [
            'id'           => 1,
            'parent_id'    => 0,
            'phone'        => 18476923223,
            'name'         => '超级管理员',
            'password'     => Hash::make('admin123'),
            'avatar'       => '',
            'sex'          => '男',
            'is_super'     => 'y',
            'introduction' => '默认超级管理员',
            'status'       => 'normal'
        ];
        \Project\Admin\Models\AdminUser::updateOrCreate(['id' => $default['id']], $default);
    }
}
